﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class user_modify_pwd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            TUser1.CheckUser(this);

            btnSave.Attributes.Add("OnClick", "javascript:return chk();");
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string userid = this.Session["userid"].ToString();

        if (TUser1.CheckLogin(userid, oldpassword.Text))
        {
            TUser1 oUser = new TUser1(userid);
            oUser.ChangePWD(newpassword.Text);

            msg.Text = "密码修改成功！";
        }
        else
        {
            msg.Text = "密码不正确！";
        }
    }
}
